package com.joven.infra.common.model;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.List;

/**
 * 分页值结果对象
 *
 * @author Joven
 * @date 2022-01-06 18:21:27
 */
@Data
@ApiModel("分页值结果对象")
public class PageResult<T> {
    @ApiModelProperty("分页数据")
    protected List<T> records;

    @ApiModelProperty("数据总数")
    protected long total;

    @ApiModelProperty("分页大小")
    protected long size;

    @ApiModelProperty("当前页码")
    protected long current;

    public PageResult() {
    }

    public PageResult(long current, long size) {
        this.current = current;
        this.size = size;
    }

    public PageResult(long current, long size, long total) {
        this.current = current;
        this.size = size;
        this.total = total;
    }
}
